<template>
  <div>
    <el-container>
      <el-header><h3>后台管理系统</h3></el-header>
      <el-container>
        <el-aside width="200px">
          <el-row class="tac">
            <el-col :span="24">
              <!-- <h5>侧边导航栏</h5> -->
              <el-menu
                default-active="1-1"
                class="el-menu-vertical-demo"
                @open="handleOpen"
                @close="handleClose"
                @select="handleSelect"
                background-color="#545c64"
                text-color="#fff"
                active-text-color="#ffd04b"
              >
                <el-submenu index="1">
                  <template slot="title">
                    <i class="el-icon-location"></i>
                    <span>部门管理</span>
                  </template>
                  <el-menu-item-group>
                    <el-menu-item index="1-1" @click="num=0">预览部门</el-menu-item>
                    <el-menu-item index="1-2" @click="num=1">管理部门</el-menu-item>
                  </el-menu-item-group>
                </el-submenu>

                <el-submenu index="2">
                  <template slot="title">
                    <i class="el-icon-s-check"></i>
                    <span slot="title">职责管理</span>
                  </template>
                  <el-menu-item-group>
                    <el-menu-item index="2-1" @click="num=2">预览职责</el-menu-item>
                    <el-menu-item index="2-2" @click="num=3">管理职责</el-menu-item>
                  </el-menu-item-group>
                </el-submenu>

                <el-submenu index="3">
                  <template slot="title">
                    <i class="el-icon-s-custom"></i>
                    <span slot="title">员工管理</span>
                  </template>
                  <el-menu-item-group>
                    <el-menu-item index="3-1" @click="num=4">预览员工</el-menu-item>
                    <el-menu-item index="3-2" @click="num=5">管理员工</el-menu-item>
                  </el-menu-item-group>
                </el-submenu>

              </el-menu>
            </el-col>
          </el-row>
        </el-aside>

        <el-main>
            <!-- 预览部门 -->
            <span v-if="num===0">      <depar-list/> </span>
            <p v-else-if="num===1">  <set-depar/> </p>
            <!-- 预览职责 -->
            <p v-else-if="num===2"> <duty-list/>  </p>
            <!-- 管理职责 -->
            <p v-else-if="num===3">管理职责        </p>
            <!-- 预览员工 -->
            <p v-else-if="num===4">    <staff-list/>         </p>
            <!-- 管理员工 -->
            <p v-else>管理员工                 </p>





          
          <!-- <span class="demonstration">完整功能</span> -->
          <!-- <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage4"
            :page-sizes="[100, 200, 300, 400]"
            :page-size="100"
            layout="total, sizes, prev, pager, next, jumper"
            :total="400"
          >
          </el-pagination> -->

        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import DeparList from '../components/DeparList.vue';
import DutyList from '../components/DutyList.vue';
import SetDepar from '../components/SetDepar.vue';
import StaffList from '../components/StaffList.vue';


export default {
  name: "Day424",
  data() {
    return {
      users: [],
      loading: true,
      num:0,
    };
  },
  props: {},

  components: {
    DeparList,
    DutyList,
    StaffList,
    SetDepar,




},

  created() {},

  mounted() {},

  methods: {
    handleOpen(key, keyPath) {
      console.log(key, keyPath);
    },
    handleClose(key, keyPath) {
      console.log(key, keyPath);
    },
    // handleSelect(value) {
    //   console.log("选择菜单栏:", value);
    //   setTimeout(() => {
    //     this.users = [
    //       { name: "zhangsan", age: 13 },
    //       { name: "lisi", age: 18 },
    //       { name: "wangwu", age: 27 },
    //     ];
    //     this.loading = false;
    //   }, 2000);
    // },
  },

  computed: {},

  watch: {},

  directives: {},

  filters: {},
};
</script>

<style scoped>
* {
  margin: 0;
}
.el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }
</style>
